﻿using MyMeeting.Extensions;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyMeeting.ViewModels
{
    public  class MeetingViewModel:BindableBase
    {
        private readonly IDialogService dialogHost;
        public MeetingViewModel(IDialogService dialog)
        {
            dialogHost = dialog;
            OpenDialogCommand = new (OpenDialog);
        }

        private void OpenDialog(string obj)
        {
            if(string.IsNullOrWhiteSpace(obj))
            { return; }
            LoginRoom();
            if (obj=="MeetDemoView")
            {
                
            }
            if(obj=="ShareScreenView")
            {

            }

            dialogHost.ShowDialog(obj);
        }
        private void LoginRoom()
        {
            var user = PrismManager.CurrentUser;
            user.Token = "007eJxTYCi4t2J600TxmT/Uj08zlJqyzcW5Y6XJvt/RLJm2MgoF9y4qMJgkmqSZJ6WamaQlGpoYmKQmpSSam5hbmKSlWiYmG1sY1q08n94QyMjwr+GWJCMDIwMLEIP4TGCSGUyygElWBgMjUxNzRgYtAB8/IvY=";
            user.Channel= "02547";
        }
        public DelegateCommand<string> OpenDialogCommand { get; set; }
    }
}
